﻿namespace zlhis_restful.Controllers
{
    using Microsoft.AspNetCore.Mvc;
    using zlhis_restful.Common;

    /// <summary>
    /// Defines the <see cref="TokenController" />.
    /// </summary>
    [ApiController]
    [Route("[controller]")]
    public class TokenController : ControllerBase
    {
        /// <summary>
        /// The GetToken.
        /// </summary>
        /// <returns>The <see cref="ActionResult{ResultJson}"/>.</returns>
        [HttpGet]
        [Route("/GetToken")]
        public ActionResult<ResultJson> GetToken()
        {
            TokenModelJwt tokenModel = new TokenModelJwt { Uid = 1, Role = "admin", Work = "计算机" };
            return new ResultJson().SetSuccessResult(JWTHelper.IssueJwt(tokenModel));
        }
    }
}
